﻿using GN.Pay.Client.Request.MerchantMember;
using GN.Pay.Client.Response.MerchantMember;
using GN.Pay.Client.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GN.Pay.Client.Services
{
    /// <summary>
    /// 商户会员服务
    /// </summary>
    class MerchantMemberService : APayService, IMerchantMemberService
    {
        private const string BankCardList_Service = "Merchant.Member.BankCrad.List";
        private const string BankCardBindApply_Service = "Merchant.Member.BankCrad.Bind.Apply";
        private const string BankCardBind_Service = "Merchant.Member.BankCrad.Bind";

        public MerchantMemberService(IServiceClient client) : base(client)
        {
        }

        /// <summary>
        /// 银行卡列表
        /// </summary>
        /// <param name="request">请求</param>
        /// <returns></returns>
        public List<BankCardInfoResponse> BankCardList(MemberRequest request)
        {
            ExceptionUtils.CheckNotNull(request, nameof(request));
            return this.Client.CallService<MemberRequest, List<BankCardInfoResponse>>(BankCardList_Service, request);
        }

        /// <summary>
        /// 银行卡绑定申请
        /// </summary>
        /// <param name="request">请求</param>
        /// <returns></returns>
        public BankCardBindApplyResponse BankCardBindApply(BankCardBindApplyRequest request)
        {
            ExceptionUtils.CheckNotNull(request, nameof(request));
            return this.Client.CallService<BankCardBindApplyRequest, BankCardBindApplyResponse>(BankCardBindApply_Service, request);
        }

        /// <summary>
        /// 银行卡绑定
        /// </summary>
        /// <param name="request">请求</param>
        /// <returns></returns>
        public BankCardInfoResponse BankCardBind(BankCardBindRequest request)
        {
            ExceptionUtils.CheckNotNull(request, nameof(request));
            return this.Client.CallService<BankCardBindRequest, BankCardInfoResponse>(BankCardBind_Service, request);
        }

    }
}
